<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
<title>第三次作业：登录成功界面</title>


<style>
#p1{color:blue;font-size:20pt;}
body{background-color:#eeeeee}
div{margin:auto;width:300px;border:3px solid #73AD21;padding: 10px;font-size:40pt;color:#ef5bcd;background:#ffdf6f}
</style>


</head>
<body>
<div>
<p style="text-align:center">登录成功</p>
</div>
<p id=p1 style="text-align:center">用户信息</p>
<table align="center" border="1">
	<tr>
		<td>用户名</td>
		<td><font id="tr_username"></font></td>
	</tr>
	<tr>
		<td>邮箱</td>
		<td><font id="email"></font></td>
	</tr>
	<tr>
		<td>注册时间</td>
		<td><font id="register_time"></font></td>
		</tr>
	<tr>
		<td>登录时间</td>
		<td><font id="login_time"></font></td>
    </tr>
</table>
<script type="text/javascript">
	var storage = window.localStorage;
    var password = storage["token"]; 
    if (password.length != 0) {
        var username = storage["username"];
        var aName = document.getElementById('username');
        aName.text = username;

        var usernameId = document.getElementById('tr_username');
        usernameId.innerHTML = username;

        var email = storage["email"];
        var emailId = document.getElementById('email');
        emailId.innerHTML = email;

        var registerTime = storage["registerTime"]; 
        var registerTimeId = document.getElementById('register_time');
        registerTimeId.innerHTML = registerTime;
    
        var loginTime = storage["loginTime"];
        var loginTimeId = document.getElementById('login_time');
        loginTimeId.innerHTML = loginTime;
    } else {
        self.location = 'https://kowaji.gitee.io/no.3login';
        console.log("");
    }
    
        var date = new Date();
        var currentTime = date.toLocaleString();
        storage["loginTime"] = currentTime;
</script>>
</body>
</html>